package com.recommended.service.impl;

import com.recommended.dao.DataInfoMapper;
import com.recommended.domain.DataInfo;
import com.recommended.service.DataInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class DataInfoServiceImpl implements DataInfoService {
    @Autowired
    private DataInfoMapper dataInfoMapper;

    @Override
    public List<DataInfo> findAll() {
        return dataInfoMapper.findAll();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insertAll(List<DataInfo> dataInfoList) {
        dataInfoMapper.insertAll(dataInfoList);
    }

    @Override
    public DataInfo findById(int dataId) {
        return dataInfoMapper.findById(dataId);
    }
}
